<template>
	<view class="security_car">
		<view class="sc_title">
			<view class="one">租车保障 · 安心出行</view>
			<view class="two">保障规则></view>
		</view>
		<view class="sc_content" >
			<view class="sc_item bgone"  @click="changeSecurity(1)">
				<view class="one">
					尊享保障
				</view>
				<view class="two">
					￥100 <br/> 
					<span>￥110</span> 
				<tm-icons v-if="current == 1" :size="32" name="icon-check"></tm-icons>
				</view>
				<view class="three">
					全额车损（豁免）<br/>
					<span>
						（含轮胎、轮毂）
					</span>
				</view>
				<view class="four">
					三者保险增至30万（限额）
				</view>
				<view class="five" >
				</view>
			</view>
			<view class="sc_item bgtwo"  @click="changeSecurity(2)">
				<view class="one">
					全程无忧
				</view>
				<view class="two">
					￥180 <br/>
					<span>￥210</span>
						<tm-icons  v-if="current == 2" :size="32" name="icon-check"></tm-icons>
				</view>
				<view class="three">
					全额车损（豁免）<br/>
					<span>
						（含轮胎、轮毂）
					</span>
				</view>
				<view class="three">
					乘客保险增至<br/>
					<span>
						5万/人
					</span>
				</view>
				<view class="four">
					三者保险增至120万（限额）
				</view>
				<view class="five" >
				</view>
			</view>
			<view class="sc_item bgthree"  @click="changeSecurity(3)">
				<view class="one">
					百万守护
				</view>
				<view class="two">
					￥160 <br/>
					<span>￥170</span>
					<tm-icons v-if="current == 3" :size="32" name="icon-check"></tm-icons>
				</view>
				<view class="three">
					全额车损（豁免）<br/>
					<span>
						（含轮胎、轮毂）
					</span>
				</view>
				<view class="four">
					三者保险增至100万（限额）
				</view> 
				<view class="five" >
				</view>
			</view>
		</view>
	
	</view>
</template>

<script>
export default {
	name: 'SecurityCar',

	data() {
		return {
			checked:false,
			list:[{id:'1',price:100},{id:'2',price:180},{id:'3',price:160}],
			current:1
		};
	},
	methods: {
		changeSecurity(id){
			this.current = id
			let obj = this.list.find((item,index)=>{
				return item.id == this.current
			})
			this.$emit('getprice',obj.price)
			// console.log(obj)
			
		}
	}
};
</script>

<style lang="scss" scoped>
.security_car {
	background-color: #ffffff;
	width: 90%;
	margin: auto;
	border-radius: 30rpx;
	.sd_content {
		height: 100%;
		width: 220rpx;
		border-radius: 20rpx;
		background-color: black;
		margin-right: 10rpx;
	}
	.sc_title {
		padding: 10rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		.one {
			font-weight: 600;
			font-size: 32rpx;
		}
		.two {
			font-size: 24rpx;
			font-weight: 500;
			color: #919191;
		
		}
	}
	.sc_content {
		display: flex;
		justify-content: space-around;
		align-items: stretch;
		padding: 20rpx;
		box-sizing: border-box;
		.bgone{
			background-color: #f3fcfb;
		}
		.bgtwo{
			background-color: #fef9f3;
		}
		.bgthree{
			background-color: #f6f9fe;
		}
		.sc_item {
			width: 30%;
			font-size: 24rpx;
			color: #919191;
			padding: 20rpx;
			margin: 0 6rpx;
			border-radius: 30rpx;
			.one{
				 font-size: 32rpx;
				 font-weight: 600;
				 color: black;
			}
			.two{
				font-size: 28rpx;
				font-weight: 530;
				color: black;
				span{
					text-decoration: line-through;
					font-size: 24rpx;
					margin-right: 30rpx;
				}
			}
			.three{
				margin: 20rpx 0;
				span{ 
					color: orange;
				}
			}
			.five{
				text-align: center;
				span{
					width: 40rpx;
					height: 40rpx;
					border: #919191;
					
					display: block;
					margin: auto;
					border-radius: 40rpx;
				}

			}
			.bgcolor{
				width: 40rpx;
				height: 40rpx;
				border: #919191;
				display: block;
				margin: auto;
				border-radius: 40rpx;
				background-color: #5fcab8;
			}
			// background-color: black;
		}
	}
}
</style>
